#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e6+5;
const int mod=1e9+7;
int n,k,a[N],jc[N],inv[N],ans,f[N][2];
inline int ksm(int x,int y) {
	int ret=1;
	while(y) {
		if(y&1)
			ret=ret*x%mod;
		x=x*x%mod;
		y>>=1;
	}
	return ret;
}
inline int C(int x,int y) {
	if(x<y||y<0) return 0;
	return jc[x]*inv[y]%mod*inv[x-y]%mod;
}
inline int A(int x,int y) {
	if(x<y||y<0) return 0;
	return jc[x]*inv[x-y]%mod;
}
signed main() {
	freopen("game.in","r",stdin);
	freopen("game.out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	jc[0]=1;
	for(int i=1;i<N;i++) jc[i]=jc[i-1]*i%mod;
	inv[N-1]=ksm(jc[N-1],mod-2);
	for(int i=N-1;i;i--) inv[i-1]=inv[i]*i%mod;
	cin>>n>>k;
	for(int i=1;i<=n;i++) cin>>a[i];
	if(n==1) {
		cout<<a[1];
		return 0;
	}
	f[1][1]=1;
	for(int i=2;i<=n;i++) {
		f[i][1]=(f[i-1][1]*(i-2)%mod+f[i-1][0])%mod;
		f[i][0]=(f[i-1][0]*(i-2)%mod+f[i-1][1])%mod;
	}
	int sum=0;
	for(int i=1;i<=n;i++) {
		int s=(f[i][1]-f[i][0]+mod)%mod*C(k,i-1)%mod;
		ans=(ans+(sum+s*A(n-i,k-i+1)%mod)%mod*a[i]%mod)%mod;
		sum=(sum+s*A(n-i-1,k-i+1)%mod)%mod;
	}
	ans=ans*ksm(A(n-1,k),mod-2)%mod;
	cout<<ans;
	return 0;
}
//594707023
